package com.ruoyi.project.es.controller;

import com.ruoyi.project.es.dao.UserSearchRepository;
import com.ruoyi.project.es.model.User;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/front")
public class UserOperationApi {

    @Autowired
    private ElasticsearchTemplate elasticsearchTemplate;

    @Autowired
    private UserSearchRepository userSearchRepository;

    @RequestMapping("/add")
    public String insert(){

        User u = new User(3,"张安");
        userSearchRepository.save(u);
        return "success";
    }


}
